package com.huanbao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 环宝用户表
 * </p>
 *
 * @author zq
 * @since 2021-04-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("hb_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "账号不能为空")
    private String username;

    /**
     * 头像
     */
    private String avatar;

    @NotBlank(message = "密码不能为空")
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

    private String telephone;

    /**
     * 1：普通用户，2：志愿者，3：监管者，4：协助监管
     */
    private Integer type;

    /**
     * 最近登录时间
     */
    private LocalDateTime lastLoginTime;

    /**
     * 创建时间
     */
    private LocalDateTime createdDt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedDt;

    /**
     * 账户
     */
    private Long account;

    /**
     * 真实姓名
     */
    private String name;

    /**
     * 收获地址
     */
    private String address;

    /**
     * 所在区域
     */
    private String area;

    /**
     * 删除状态 1：是；0：否
     */
    private Integer deleted;

}
